<?xml version="1.0" encoding="ISO-8859-1" ?>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@include file="../../context.jsp"%>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Monthly Share Data List</title>
<%@include file="../common_Admin_imports.jsp"%>
<%@include file="../common_list_page.jsp"%>

<script type="text/javascript">
	$(document)
			.ready(
					function() {
						resetSelectAll();
						$('#selectAll').on('click', function() {
							selectAll();
						});
						paginationNextBtn("${pageContext.request.contextPath}/admin/monthlysharedata/list.html?totalRecords=${monthlyShareDataPage.totalNoOfRecords}&page=");
					});

	function deleteFiltered() {
		var proceed = confirm("Are you sure, you want to delete the searched dataset ? If you select yes, the operation cannot be undone");
		if (proceed) {
			var baseUrl = "${pageContext.request.contextPath}/admin/monthlysharedata/deleteFiltered.html";
			document.location = baseUrl;
		}

		return proceed;
	}
</script>
<style type="text/css">
.datepicker,.searchSelector {
	margin-right: 10px;
	width: 100px;
}

.searchSelector {
	margin-right: 10px;
	width: 150px;
}

.btnSerch {
	padding: 4px;
}
</style>
</head>
<body>
	<div class="main_wrapper">
		<div class="header_wrapper">
			<div class="container-fluid">
				<div class="header_inner_wrapper clearfix">
					<div class="row-fluid">
						<div class="header_left span4">List of Monthly Share Data</div>
						<div class="header_right span8">
							<!-- search section -->
							<jsp:include page="../search.jsp">
								<jsp:param name="page" value="monthlysharedata" />
							</jsp:include>
							<!-- end of search section -->
						</div>
					</div>
				</div>

				<div class="row-fluid">
					<div class="main_table">
						<form:form method="POST"
							action="${pageContext.request.contextPath}/admin/monthlysharedata/delete/selected.html">
							<table class="table table-bordered table-striped">
								<thead>
									<tr>
										<th id="tableHeader"><input type="checkbox"
											id="selectAll" name="deleteHeader" /></th>
										<th id="tableHeader">No</th>
										<th id="tableHeader">Company Name</th>
										<th id="tableHeader">Date</th>
										<th id="tableHeader">Share Price</th>
										<th id="tableHeader">high</th>
										<th id="tableHeader">low</th>
										<th id="tableHeader">turnOver</th>
										<th id="tableHeader">volume</th>
										<th id="tableHeader">no Of Trade</th>
										<th id="tableHeader">Opening Price</th>
										<th></th>
										<th></th>
									</tr>
								</thead>
								<tbody>
									<c:forEach var="monthlyShareData"
										items="${monthlyShareDataPage.pageData}">
										<tr>
											<td><input type="checkbox" class="selectedId"
												name="deleteIds" value="${monthlyShareData.id}" /></td>
											<td>${monthlyShareData.id}</td>
											<td>${monthlyShareData.company.name}</td>
											<td id="dateAlign"><fmt:formatDate
													pattern="${dateFormat}" value="${monthlyShareData.date}" /></td>
											<td id="numberAlign"><fmt:formatNumber
													maxFractionDigits="${MaxFraction}"
													minFractionDigits="${MinFraction}"
													value="${monthlyShareData.sharePrice}" /></td>
											<td id="numberAlign"><fmt:formatNumber
													maxFractionDigits="${MaxFraction}"
													minFractionDigits="${MinFraction}"
													value="${monthlyShareData.high}" /></td>
											<td id="numberAlign"><fmt:formatNumber
													maxFractionDigits="${MaxFraction}"
													minFractionDigits="${MinFraction}"
													value="${monthlyShareData.low}" /></td>
											<td id="numberAlign"><fmt:formatNumber
													maxFractionDigits="${MaxFraction}"
													minFractionDigits="${MinFraction}"
													value="${monthlyShareData.turnOver}" /></td>
											<td id="numberAlign"><fmt:formatNumber
													maxFractionDigits="${MaxFraction}"
													minFractionDigits="${MinFraction}"
													value="${monthlyShareData.volume}" /></td>
											<td id="numberAlign"><fmt:formatNumber
													maxFractionDigits="${MaxFraction}"
													minFractionDigits="${MinFraction}"
													value="${monthlyShareData.noOfTrade}" /></td>
											<td id="numberAlign"><fmt:formatNumber
													maxFractionDigits="${MaxFraction}"
													minFractionDigits="${MinFraction}"
													value="${monthlyShareData.openingPrice}" /></td>
											<td><a class="btn btn-info"
												href="${pageContext.request.contextPath}/admin/monthlysharedata/edit/${monthlyShareData.id}.html">Edit</a>
											</td>
											<td><a class="btn btn-danger"
												lang="${pageContext.request.contextPath}/admin/monthlysharedata/delete/${monthlyShareData.id}.html"
												href="javascript:void(0);"
												onclick="return confirmAndDelete(this);">Delete</a></td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
							<div>
								<div>
									<input
										onclick="return confirm('Are you sure, you want to delete all the selected results. This opperation cannot be undone');"
										class="btn btn-danger" type="submit" value="Delete Selected" />
									<input onclick="return deleteFiltered();"
										class="btn btn-danger" type="button"
										value="Delete Filtered List" />
								</div>
							</div>
						</form:form>
						<!-- paging section -->
						<div class="pagination pagination-right">
							<!-- page number -->
							Page&nbsp;<input value="${monthlyShareDataPage.currentPageNo}"
								style="width: 50px;" type="number" min="0"
								max="${monthlyShareDataPage.totalNoOfPages }" id="pageNum">
								<!-- end page number -->
								<ul>
									<li><c:if test="${monthlyShareDataPage.showPrev}">
											<a
												href="${pageContext.request.contextPath}/admin/monthlysharedata/list.html?page=${monthlyShareDataPage.currentPageNo-1}&totalRecords=${monthlyShareDataPage.totalNoOfRecords}">Prev</a>
										</c:if></li>
									<c:forEach begin="${monthlyShareDataPage.startPageNo}"
										var="page" end="${monthlyShareDataPage.endPageNo}">
										<li><a
											<c:if test="${monthlyShareDataPage.currentPageNo==page}">style="background-color:#79BAEC"</c:if>
											href="${pageContext.request.contextPath}/admin/monthlysharedata/list.html?page=${page}&totalRecords=${monthlyShareDataPage.totalNoOfRecords}">${page}</a></li>&nbsp;
							</c:forEach>
									<li><c:if test="${monthlyShareDataPage.showNext}">
											<a
												href="${pageContext.request.contextPath}/admin/monthlysharedata/list.html?page=${monthlyShareDataPage.currentPageNo+1}&totalRecords=${monthlyShareDataPage.totalNoOfRecords}">Next</a>
										</c:if></li>
									<li><a class="pageCountLink">${monthlyShareDataPage.totalNoOfPages }
											Pages</a></li>
								</ul>
						</div>
						<div>
							<br></br>
						</div>
						<!-- paging section -->
						<div class="btn btn-success">
							<a
								href="${pageContext.request.contextPath}/admin/monthlysharedata/add.html">New</a>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>